<include file="Index:header" />


<div class="container-fluid">
	<div class="row-fluid">
		<!--左栏 starts -->
		<include file="User:left" />
		<!--左栏 end -->


		<!-- content starts -->
		<form method="post">
			<input type="hidden" name="id" value="{$group_data.id}"/>
			<input type="hidden" name="rules" id="menuids" value=""/>
		<div id="content" class="span10">

			<ul class="breadcrumb">
				<li>
					<a href="__APP__/ADMINADSS.html">首页</a> <span class="divider">/</span>
				</li>
				<li class="active">首页 &gt; 用户组列表 &gt; 分配权限</li>
			</ul>
			<div class="zTreeDemoBackground left" style="height: 550px;width:400px; overflow-y: auto">
				<ul id="treeDemo" class="ztree" style="height: 100%; width:95%;"></ul>
			</div>
			<div class="modal-footer">
				<button type="submit" class="btn btn-primary" >确认添加</button>
			</div>
		</div>
		</form>
		<!-- content end -->
	</div>

	<link rel="stylesheet" href="../../../css/zTreeStyle/zTreeStyle.css" type="text/css">
	<!--<script type="text/javascript" src="../../../js/jquery-1.4.4.min.js"></script>-->
	<script src="__PUBLIC__/zTree_v3/js/jquery-1.4.4.min.js"></script>
	<script src="__PUBLIC__/zTree_v3/js/jquery.ztree.core.js"></script>
	<script src="__PUBLIC__/zTree_v3/js/jquery.ztree.excheck.js"></script>



	<script type="text/javascript">
        var setting = {
            check: {
                enable: true,
                chkStyle: "checkbox",
                chkboxType: { "Y": "ps", "N": "ps" }
            },
            data: {
                simpleData: {
                    enable: true
                }
            },
            callback:{
                onCheck:zTreeOnCheck
            }
        };

        var zNodes = eval({$ztreelist});

        function zTreeOnCheck(event, treeId, treeNode) {
            var treeObj=$.fn.zTree.getZTreeObj("treeDemo");
            var nodes=treeObj.getCheckedNodes(true),menuids="";
            for(var i=0;i<nodes.length;i++){
                if(i == nodes.length-1){
                    menuids+=nodes[i].id;//id字符串拼接
                }else{
                    menuids+=nodes[i].id + ",";
                }
            }
            $("#menuids").val(menuids);
        };

        $(document).ready(function(){
            $.fn.zTree.init($("#treeDemo"), setting, zNodes);
        });
	</script>